let {src,dest,watch} = require('gulp');
let htmlmin = require('gulp-htmlmin');
let sass = require('gulp-sass');
let cssnano = require('gulp-cssnano');
let uglify = require('gulp-uglify');
let rename = require('gulp-rename');
let imagemin = require('gulp-imagemin');
let babel = require('gulp-babel');
let concat = require('gulp-concat');

function fnCopyIndex(){
    return src('./src/index.html').pipe(dest('./dist'));
}
function fnHTML(){
    return src('./src/page/*.html').pipe(htmlmin()).pipe(dest('./dist/page'));
}
function fnCSS(){
    return src('./src/sass/*.scss').pipe(sass()).pipe(cssnano()).pipe(rename({suffix : '.min'})).pipe(dest('./dist/css'))
}
function fnJS(){
    return src('./src/js/*.js')
    .pipe(babel({
        presets: ['@babel/env']
    }))
    .pipe(uglify())
    .pipe(rename({suffix : '.min'}))
    .pipe(dest('./dist/js'));
}
